package com.example.template.service;

import com.example.template.common.base.BaseService;
import com.example.template.entity.Permission;
import com.example.template.vo.MenuCardVO;
import com.example.template.vo.TreeSelect;

import java.util.List;
import java.util.Set;

/**
 * @className: PermissionService
 * @description: TODO 类描述
 * @author: Kuangkeli
 * @date: 2024/01/28 16:54
 **/
public interface PermissionService extends BaseService<Permission> {

    /**
     * 根据角色列表获取菜单列表
     *
     * @param userId
     * @return
     */
    Set<Permission> getMenuListByUserId(long userId);

    /**
     * 根据用户id获取对应权限ids
     *
     * @param roleId
     * @return
     */
    Set<Long> getPermIdsByRoleId(long roleId);


    List<String> getPermsListByUserId(long userId);

    Set<Permission> getPermissionListByUserId(long userId);

    List<MenuCardVO> getMenuTreeByUserId(long userId);


    List<Permission> getChildPerms(List<Permission> list, int parentId);

    List<Permission> buildMenuTree(List<Permission> menus);

    List<TreeSelect> buildMenuTreeSelect(List<Permission> menus);

    List<Permission> selectAll();
}
